Tiled/Image/Textured Fills
SciChart transforms WPF brushes into Textures for use in it’s GPU-accerated drawing engine. For this reason, many of the standard WPF brushes (e.g. TileBrush, Imagebrush) don’t work quite as expected. It is however still possible to generate a hatched brush by using the WPF VisualBrush type in many RenderableSeries.
For instance, applying a VisualBrush to a FastMountainRenderableSeries.Fill property, you get the following result:
Applying a VisualBrush with tiling to a FastMountainRenderableSeries.Fill, you can get a tiled effect
Here’s the code sample to achieve it:
Tiled / Image / Textured Fills |
Copy Code |
---|---|
<!-- Declare RenderableSeries --> <s:SciChartSurface.RenderableSeries> <s:FastMountainRenderableSeries x:Name="mountainRenderSeries" Stroke="#AAFFC9A8" StrokeThickness="2"> <s:FastMountainRenderableSeries.Fill> <VisualBrush TileMode="Tile" Viewport="0,0,10,10" ViewportUnits="Absolute" Viewbox="0,0,10,10" ViewboxUnits="Absolute"> <VisualBrush.Visual> <Canvas> <Rectangle Fill="Transparent" Width="10" Height="10" /> <Path Stroke="#AAFF8D42" Data="M 0 0 l 10 10" /> <Path Stroke="#AAFF8D42" Data="M 0 10 l 10 -10" /> </Canvas> </VisualBrush.Visual> </VisualBrush> </s:FastMountainRenderableSeries.Fill> </s:FastMountainRenderableSeries> </s:SciChartSurface.RenderableSeries> |
See Also